package com.spring.demo6.eg7;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author vhans
 */
@Configuration
public class MainConfig9 {

    @Bean
    public IService service1() {
        return new Service1();
    }

    @Bean
    @Primary // 将service2作为主要候选者
    public IService service2() {
        return new Service2();
    }

    @Bean
    public InjectService injectService() {
        return new InjectService();
    }
}
